import { ref } from 'vue'
import PageContent from '@/components/page-content'

export function usePageSearch(): any[] {
  const pageContentRef = ref<InstanceType<typeof PageContent>>()

  const handleSearch = (val: any) => {
    console.log(val)
    pageContentRef.value?.getPageData(val)
  }

  const handleReset = () => {
    pageContentRef.value?.getPageData()
  }

  return [pageContentRef, handleSearch, handleReset]
}
